#ifndef USER_AHT20_H
#define USER_AHT20_H

#include "stdint.h"
#include "driver/i2c.h"
#include "driver/gpio.h"
#include "esp_types.h"

#define i2c_master_port I2C_NUM_0
#define aht20_addr    0x38
#define ACK_CHECK_EN  0x1                       /*!< I2C master will check ack from slave*/
#define ACK_CHECK_DIS 0x0                       /*!< I2C master will not check ack from slave */
#define ACK_VAL  0x0                            /*!< I2C ack value */
#define NACK_VAL 0x1                            /*!< I2C nack value */

#define AHT20_SCL_PIN 18
#define AHT20_SDA_PIN 19


esp_err_t user_iic_init(void);
void check_calibration();
bool getbit(int NUM, int n);
void trigger_measure();
void user_aht20_task(void *ignore);


#endif /* APP_INC_ATH20_H_ */



